package com.tor.util;

import java.io.File;
import java.io.FileInputStream;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.security.MessageDigest;
import java.util.Enumeration;

public class Test {


    public static void main(String[] args) throws Exception{
// 获得本机的所有网络接口
//        Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
//        while (nifs.hasMoreElements()) {
//            NetworkInterface nif = nifs.nextElement();
//            // 获得与该网络接口绑定的 IP 地址，一般只有一个
//            Enumeration<InetAddress> addresses = nif.getInetAddresses();
//            while (addresses.hasMoreElements()) {
//                InetAddress addr = addresses.nextElement();
//                if (addr instanceof Inet4Address) { // 只关心 IPv4 地址
//                    System.out.println("网卡接口名称：" + nif.getName());
//                    System.out.println("网卡接口地址：" + addr.getHostAddress());
//                    System.out.println();
//                }
//            }
//        }

        File trainFile = new File("/home/ubuntu2/Test.py");
        String trainPath = trainFile.getAbsolutePath();

        String fileSe = trainFile.separator;
        System.out.println(trainPath);
        System.out.println(fileSe);
        System.out.println(trainFile.getPath());
        System.out.println(trainFile.getCanonicalPath());
        System.out.println(trainFile.getParent());
    }

}
